package com.heima.wemedia.config;

import com.heima.wemedia.interceptor.WmTokenInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author shitou
 * @className WebMvcConfig
 * @description: TODO
 */
@Configuration
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("--wemedia拦截器--start");
        registry.addInterceptor(new WmTokenInterceptor()).addPathPatterns("/**");
    }
}
